/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package org.fh.itsbankomat.businesslogic.model;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author MeinLaptop
 */
@Entity
@Table(name = "GELDAUTOMAT")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Geldautomat.findAll", query = "SELECT g FROM Geldautomat g"),
    @NamedQuery(name = "Geldautomat.findByGeldautomatid", query = "SELECT g FROM Geldautomat g WHERE g.geldautomatid = :geldautomatid"),
    @NamedQuery(name = "Geldautomat.findByStatus", query = "SELECT g FROM Geldautomat g WHERE g.status = :status"),
    @NamedQuery(name = "Geldautomat.findByGeldmenge", query = "SELECT g FROM Geldautomat g WHERE g.geldmenge = :geldmenge"),
    @NamedQuery(name = "Geldautomat.findByPin", query = "SELECT g FROM Geldautomat g WHERE g.pin = :pin"),
    @NamedQuery(name = "Geldautomat.findByMessage", query = "SELECT g FROM Geldautomat g WHERE g.message = :message")})
public class Geldautomat implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "GELDAUTOMATID")
    private Integer geldautomatid;
    @Size(max = 10)
    @Column(name = "STATUS")
    private String status;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "GELDMENGE")
    private BigDecimal geldmenge;
    @Size(max = 4)
    @Column(name = "PIN")
    private String pin;
    @Size(max = 50)
    @Column(name = "MESSAGE")
    private String message;

    public Geldautomat() {
    }

    public Geldautomat(Integer geldautomatid) {
        this.geldautomatid = geldautomatid;
    }

    public Geldautomat(Integer geldautomatid, BigDecimal geldmenge) {
        this.geldautomatid = geldautomatid;
        this.geldmenge = geldmenge;
    }

    public Integer getGeldautomatid() {
        return geldautomatid;
    }

    public void setGeldautomatid(Integer geldautomatid) {
        this.geldautomatid = geldautomatid;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public BigDecimal getGeldmenge() {
        return geldmenge;
    }

    public void setGeldmenge(BigDecimal geldmenge) {
        this.geldmenge = geldmenge;
    }

    public String getPin() {
        return pin;
    }

    public void setPin(String pin) {
        this.pin = pin;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (geldautomatid != null ? geldautomatid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Geldautomat)) {
            return false;
        }
        Geldautomat other = (Geldautomat) object;
        if ((this.geldautomatid == null && other.geldautomatid != null) || (this.geldautomatid != null && !this.geldautomatid.equals(other.geldautomatid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.fh.itsbankomat.businesslogic.model.Geldautomat[ geldautomatid=" + geldautomatid + " ]";
    }
    
}
